<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <!-- 引用其他html文件 -->
  <% include header.html%>
  <h2>卧槽卧槽</h2>
  <ul>
    <li>id: <%= id%></li>
    <li>姓名: <%= name%></li>
    <li>年龄: <%= age%></li>
    <li>
      我的爱好:
      <ul>
        <% 
        for(let i=0; i< aihao.length ; i++ )
          {
        %>
        <li><%= aihao[i]%></li>
        <%}%>
        
      </ul>
    </li>
  </ul>
  <h2>当前时间<%= nowTime%></h2>
  <div>
    <button onclick="addCookie()">增加Cookie信息</button>
    <button onclick="delCookie()">删除Cookie信息</button>
    <button onclick="editCookie()">修改Cookie信息</button>
    <button onclick="viewCookie()">查看Cookie信息</button>
  </div>
  <script>
    function addCookie(){
      fetch("/add",{
        method: "post",
        headers: {
          "Content-Type": "application/json"
        }
      })
    }
    function delCookie(){
      fetch("/del",{
        method: "post",
        headers: {
          "Content-Type": "application/json"
        }
      })
    }
    function editCookie(){
      fetch("/edit",{
        method: "post",
        headers: {
          "Content-Type": "application/json"
        }
      })
    }
    function viewCookie(){
      fetch("/view",{
        method: "post",
        headers: {
          "Content-Type": "application/json"
        }
      }).then(res => {
       console.log( res)
      })
    }

  </script>
</body>
</html>